home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / ADA / GNAT / !gcc / adainc / 6 / ads / s-taenca < prev    next >
Text File  |  1996-02-12  |  6KB  |  101 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                 GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS               --
  4. --                                                                          --
  5. --             S Y S T E M . T A S K I N G . E N T R Y _ C A L L S          --
  6. --                                                                          --
  7. --                                  S p e c                                 --
  8. --                                                                          --
  9. --                             $Revision: 1.4 $                             --
  10. --                                                                          --
  11. --      Copyright (C) 1991,1992,1993,1994,1995 Florida State University     --
  12. --                                                                          --
  13. -- GNARL is free software; you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNARL; see file COPYING.  If not, write --
  21. -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
  22. -- MA 02111-1307, USA.                                                      --
  23. --                                                                          --
  24. -- As a special exception,  if other files  instantiate  generics from this --
  25. -- unit, or you link  this unit with other files  to produce an executable, --
  26. -- this  unit  does not  by itself cause  the resulting  executable  to  be --
  27. -- covered  by the  GNU  General  Public  License.  This exception does not --
  28. -- however invalidate  any other reasons why  the executable file  might be --
  29. -- covered by the  GNU Public License.                                      --
  30. --                                                                          --
  31. -- GNARL was developed by the GNARL team at Florida State University. It is --
  32. -- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
  33. -- State University (http://www.gnat.com).                                  --
  34. --                                                                          --
  35. ------------------------------------------------------------------------------
  36.  
  37. with Unchecked_Conversion;
  38.  
  39. package System.Tasking.Entry_Calls is
  40.  
  41.    procedure Internal_Lock
  42.      (Object : access Protection;
  43.       Ceiling_Violation : out Boolean);
  44.    --  This version of lock is used internally to lock a protected
  45.    --  object. It returns a Ceiling_Violation flag instead of raising
  46.    --  program error, avoiding the need for exception handlers in the
  47.    --  runtime to clean up after a ceiling violation.
  48.  
  49.    procedure Internal_Lock_Read_Only
  50.      (Object : access Protection;
  51.       Ceiling_Violation : out Boolean);
  52.    --  This version of lock is used internally to lock a protected
  53.    --  object for read access.
  54.    --  It returns a Ceiling_Violation flag instead of raising
  55.    --  program error, avoiding the need for exception handlers in the
  56.    --  runtime to clean up after a ceiling violation.
  57.  
  58.    procedure Lock_Server
  59.       (Entry_Call : Entry_Call_Link;
  60.        No_Server  : out Boolean);
  61.    --  This locks the server targeted by Entry_Call, returning
  62.    --  No_Server=True if no server is currently targeted.
  63.    --  This may be a task or a protected object, depending on the
  64.    --  target of the original call or any subsequent requeues.
  65.    --  It will fail if there is no such target.
  66.    --  This routine is needed because the field specifying the server
  67.    --  for this call must be protected by the server's mutex.  If it were
  68.    --  protected by the caller's mutex, accessing the server's queues would
  69.    --  require locking the caller to get the server, locking the server,
  70.    --  and then accessing the queues.  This involves holding two ATCB
  71.    --  locks at once, something which we can guarantee that it will always
  72.    --  be done in the same order, or locking a protected object while we
  73.    --  hold an ATCB lock, something which is not permitted.  Since
  74.    --  the server cannot be obtained reliably, it must be obtained unreliably
  75.    --  and then checked again once it has been locked.
  76.  
  77.    procedure Unlock_Server (Entry_Call : Entry_Call_Link);
  78.    --  Unlock the server targeted by Entry_Call.  The server must
  79.    --  be locked before calling this.
  80.  
  81.    procedure Unlock_And_Update_Server (Entry_Call : Entry_Call_Link);
  82.    --  Similar to Unlock_Server, but services entry calls if the
  83.    --  server is a protected object.
  84.  
  85.    procedure Wait_For_Completion (Entry_Call : Entry_Call_Link);
  86.    --  This procedure suspends the calling task until the specified entry
  87.    --  call has either been completed or cancelled.  It performs other
  88.    --  operations required of suspended tasks, such as performing
  89.    --  dynamic priority changes.  On exit, the call will not be queued.
  90.    --  This waits for calls on task or protected entries.
  91.    --  Abortion must be deferred when calling this procedure.
  92.  
  93.    procedure Wait_Until_Abortable
  94.      (Caller : Task_ID;
  95.       Call   : Entry_Call_Link);
  96.    --  This procedure suspends the calling task until the specified entry
  97.    --  call is queued abortably or completes.
  98.    --  Abortion must be deferred when calling this procedure.
  99.  
  100. end System.Tasking.Entry_Calls;
  101.